package com.sino.operation.Exception.exceptionRoot;

import com.sino.operation.commons.response.CenterResponseEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * TOD
 *
 * @author Administrator
 * date 2021/8/12 0012 23:28
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class SinoException extends RuntimeException {

    private Integer code;

    public SinoException(Integer code, String msg) {
        super(msg);
        this.code = code;
    }

    public SinoException(CenterResponseEnum centerResponseEnum) {
        super(centerResponseEnum.getMessage());
        this.code = centerResponseEnum.getCode();
    }
}
